This guide is intended to provide an overview of the modifications necessary to bring up a Wacom digitizer under Android.
Driver Selection
While the generic HID driver is able to work with a wide variety of hardware, Wacom digitizers require the use of specialized drivers. Each bus is handled by a distinct driver that must be compiled into the kernel for devices to be properly detected over it.
Bus | Symbol | Location |
---|---|---|
I2C |
|
Device Drivers → Input device support → Touchscreens → Wacom Tablet support (I2C) |
Serial |
|
Device Drivers → Input Device Support → Touchscreens → Wacom W8001 penabled serial touchscreen |
USB |
|
Device Drivers → Input device support → Tablets → Wacom Intuos/Graphire Tablet support (USB) |
Bluetooth |
|
Device Drivers → HID support → Special HID drivers → Wacom Bluetooth devices supported |
To configure the kernel to use a particular driver, use the make menuconfig
command inside the kernel source directory. Navigate to the location
specified in the above table, and enable the driver. Multiple drivers may
be enabled if desired.
Driver Configuration
Integrated digitizers require additional configuration to get the kernel and Android working properly with them. The procedure for each is outlined below.
I2C
I2C digitizers need to be declared in the kernel’s platform driver. The
platform driver should contain a table of type struct i2c_board_info
which
describes all I2C devices connected to the system. An entry similar to the
following will need to be added:
I2C_BOARD_INFO("WAC_I2C_EMR", 0x09)
This line tells the kernel that there is a WAC_I2C_EMR
device on the
I2C bus at address 0x09
. The former is a property of our I2C driver
and should not be changed; the latter can be determined from the digitizer
specification.
Serial
The Linux kernel exposes serial ports as TTY devices that can be accessed
by interested processes. In order to transform this into an event device
that can be used by Android, the inputattach
tool must be used. This
utility is included as part of the input-wacom package. Its README file
should be consulted for usage information. Once compiled for the target
platform, it should be called via init.rc
to run on each boot.
USB
Android assumes that all input devices connected over the USB bus are peripherals. For integrated USB sensors, it is necessary to create an Input Device Configuration file to override this heuristic. Google provides documentation on this file format here, but the important line to add in the case of USB digitizer is:
# This is an internal device, not an external peripheral
device.internal = 1
Troubleshooting
The input system contains several layers, and problems may occur in any one of them. Android includes several utilities that can be used to troubleshoot input device issues.
Kernel Devices
The dmesg
command can be used to determine if the kernel is aware of the
digitizer or not. Log lines prefixed with "input
" should contain both the
name of the input device and a sysfs path. Wacom drivers may produce their
own messages, prefixed with "Wacom".
Kernel Events
The getevent
command (see here) can be used to get information
about each event device that exists. In addition to displaying static
properties such as supported events and axis resolution, this tool can be
used to obtain event dumps from the sensor for further analysis.
Android Devices
The dumpsys
tool (see here) is able to dump information about
Android services. In particular, the input and window services contain a
wealth of information about the state of Android’s own input driver.
Android Events
One of the developer options included in the Settings app is a "Pointer Location" setting. Enabling this causes Android to draw a line wherever the pointer moves, as well as display other real time information like current pressure.